package com.bawei.base.http

import android.content.Context
import com.alibaba.android.arouter.facade.Postcard
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.facade.service.DegradeService
import com.alibaba.android.arouter.launcher.ARouter

//全局降级策略
@Route(path = "/service/degrade")
class MyDegradeService:DegradeService {
    override fun init(context: Context?) {
        //初始化不做处理
    }

    override fun onLost(context: Context?, postcard: Postcard?) {
        //当路劲输入错误，可以吐司或者同意跳转到一个特俗页面
        ARouter.getInstance().build("/app/ErrorActivity").navigation()
    }
}